#!/usr/local/bin/python3
#-*- coding:utf8 -*-
# Author Aaron 
# 2017-04-02 21:41:53

import RPi.GPIO as GPIO
import time

led = 11
switch = 7
GPIO.setmode(GPIO.BOARD)
GPIO.setup(led,GPIO.OUT)
GPIO.setup(switch,GPIO.IN)
val = GPIO.input(switch)
print("val type ",type(val))
print("HIGH ",type(GPIO.HIGH))
while True:
    val = GPIO.input(switch)
    if val == GPIO.HIGH:
        print(" high:",val)
        GPIO.output(led,GPIO.HIGH)
    else:
        GPIO.output(led,GPIO.LOW)
        print(" low:",val)
    time.sleep(1)
GPIO.cleanup()
